﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using mesoBoard.Data;
using mesoBoard.Data.Repositories;
using System.Drawing.Imaging;
using System.Drawing;

namespace mesoBoard.Services
{
    public class FileTypes : IFileTypes
    {
         
        private IRepositoriesWrapper Repositories;
      
        public FileTypes(IRepositoriesWrapper repos)
        {
            this.Repositories = repos;
        }

        public List<FileInfo> GetFileTypeImages()
        {
            DirectoryInfo fileTypeImagesDirectory = new DirectoryInfo(HttpContext.Current.Server.MapPath("~/Images/FileTypes"));
            List<FileInfo> fileTypeImages = new List<FileInfo>();
            string[] fileExtensions = { ".png", ".gif" };

            foreach (string e in fileExtensions)
            {
                fileTypeImages.AddRange(fileTypeImagesDirectory.GetFiles("*" + e));
            }

            return fileTypeImages;
        }
    }
}